<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:icecore="http://www.icefaces.org/icefaces/core"
	xmlns:ace="http://www.icefaces.org/icefaces/components"
	xmlns:ice="http://www.icesoft.com/icefaces/component">
<h:head>
	<ice:outputStyle href="#{baseMBean.securedOutPutStyleURL}"></ice:outputStyle>
</h:head>
<h:body class="#{baseMBean.securedOutPutBodyClass}">
	<f:loadBundle
		basename="com/avecsys/quotemanager/resources/messages_supplier"
		var="msgs_supplier"></f:loadBundle>
	<f:loadBundle
		basename="com/avecsys/quotemanager/resources/messages_common"
		var="msgs_common"></f:loadBundle>
	<c:if test="${baseMBean.menuBarEnabled == 'true'}">
		<h:form id="menuBarForm">
			<icecore:singleSubmit />
			<ice:menuBar styleClass="menuBar">
		        <ice:menuItems value="#{menuBarMBean.menuModel}"/>
		    </ice:menuBar>
	    </h:form>		
	</c:if>
	<h:form id="form">
		<f:event listener="#{loginMBean.isUserSignedIn}" type="preRenderView"></f:event>
		<f:event
			listener="#{quoteEventReplyListMBean.loadAllPendingQuoteEventsForBuyer}"
			type="preRenderView"></f:event>
		<div class="page-container">
			<div class="pageHeader">
				<ice:panelGrid columns="2">
					<ice:graphicImage
						url="#{quoteEventReplyListMBean.getImageResourceURL('PAGE_HEADER_ICON_SUPPLIER_INQUIRY')}"></ice:graphicImage>
					<ice:outputLabel
						value="#{msgs_supplier.LIST_OF_QUOTES_BUYER_TO_REPLY_INQUIRY_HEADER_SECTION_TITLE}"
						styleClass="pageHeaderTitleText"></ice:outputLabel>
				</ice:panelGrid>
			</div>
			<center>
				<ace:dataTable id="supplierSendQuotesTableID"
					value="#{quoteEventReplyListMBean.quoteTransactionEventsPojoList}"
					var="quoteTransactionEventsPojo" paginator="true"
					emptyMessage="#{msgs_common.DATATABLE_EMPTY_MESSAGE}"
					paginatorPosition="bottom">
					<ace:column id="addressLine1Id" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.quoteTransactionPojo.supplierMasterPojo.companyMasterPojo.companyName}"
						filterBy="#{quoteTransactionEventsPojo.quoteTransactionPojo.supplierMasterPojo.companyMasterPojo.companyName}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SEND_QUOTE_TO_LIST_HEADER_SELLER_COMPANY}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText
							value="#{quoteTransactionEventsPojo.quoteTransactionPojo.supplierMasterPojo.companyMasterPojo.companyName}" />
					</ace:column>
					<ace:column id="companyNameId" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.quoteTransactionPojo.quoteName}"
						filterBy="#{quoteTransactionEventsPojo.quoteTransactionPojo.quoteName}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SEND_QUOTE_TO_LIST_HEADER_QUOTE_NAME}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText
							value="#{quoteTransactionEventsPojo.quoteTransactionPojo.quoteName}" />
					</ace:column>
					<ace:column id="quoteValueId" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.quoteValue}"
						filterBy="#{quoteTransactionEventsPojo.quoteValue}"
						filterMatchMode="contains" style="text-align:right;">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SUPPLIER_QUOTE_LIST_HEADER_QUOTE_VALUE}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText value="#{quoteTransactionEventsPojo.quoteValue}">
							<f:convertNumber minFractionDigits="2" />
						</ice:outputText>
					</ace:column>
					<ace:column id="sellerCommentsID" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.sellerComments}"
						filterBy="#{quoteTransactionEventsPojo.sellerComments}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SUPPLIER_QUOTE_LIST_HEADER_SELLER_COMMENTS}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText
							value="#{quoteTransactionEventsPojo.sellerComments}" />
					</ace:column>
					<ace:column id="buyerCommentsID" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.buyerComments}"
						filterBy="#{quoteTransactionEventsPojo.buyerComments}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SUPPLIER_QUOTE_LIST_HEADER_BUYER_COMMENTS}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText value="#{quoteTransactionEventsPojo.buyerComments}" />
					</ace:column>
					<ace:column id="addressLine2Id" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.transactionStatus}"
						filterBy="#{quoteTransactionEventsPojo.transactionStatus}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SEND_QUOTE_TO_LIST_HEADER_TRANSACTION_STATUS}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText
							value="#{quoteEventReplyListMBean.decodeTransactionStatus(quoteTransactionEventsPojo.transactionStatus)}" />
					</ace:column>
					<ace:column id="edit" styleClass="tr1">
						<f:facet name="header">
							<ice:outputText value="#{commonMsgs.TABLE_HEADER_ACTION}"
								styleClass="tdheader" />
						</f:facet>
						<ice:commandLink
							actionListener="#{quoteEventReplyListMBean.confirmQuoteAction}">
							<f:param value="#{quoteTransactionEventsPojo.eventId}"
								name="eventId" />
							<f:param
								value="#{quoteTransactionEventsPojo.quoteTransactionPojo.quoteName}"
								name="quoteName" />
							<!-- Approve -->
							<f:param value="04" name="QUOTE_ACTION_TYPE" />
							<ice:graphicImage
								url="#{quoteEventReplyListMBean.getImageResourceURL('IMG_APPROVE_QUOTE_ICON')}"
								title="#{supplierMsgs.TOOLTIP_ACTION_APPROVE_QUOTE}"
								style="border-left:0px;border-right:0px;border-top:0px;border-bottom:0px" />
						</ice:commandLink>
						<ice:commandLink
							actionListener="#{quoteEventReplyListMBean.confirmQuoteAction}">
							<f:param value="#{quoteTransactionEventsPojo.eventId}"
								name="eventId" />
							<f:param
								value="#{quoteTransactionEventsPojo.quoteTransactionPojo.quoteName}"
								name="quoteName" />
							<!-- Amend-->
							<f:param value="02" name="QUOTE_ACTION_TYPE" />
							<ice:graphicImage
								url="#{quoteEventReplyListMBean.getImageResourceURL('IMG_AMEND_QUOTE_ICON')}"
								title="#{supplierMsgs.TOOLTIP_ACTION_MODIFY_QUOTE}"
								style="border-left:0px;border-right:0px;border-top:0px;border-bottom:0px" />
						</ice:commandLink>
						<ice:commandLink
							actionListener="#{quoteEventReplyListMBean.confirmQuoteAction}">
							<f:param value="#{quoteTransactionEventsPojo.eventId}"
								name="eventId" />
							<f:param
								value="#{quoteTransactionEventsPojo.quoteTransactionPojo.quoteName}"
								name="quoteName" />
							<!-- Ignore-->
							<f:param value="03" name="QUOTE_ACTION_TYPE" />
							<ice:graphicImage
								url="#{quoteEventReplyListMBean.getImageResourceURL('IMG_IGNORE_QUOTE_ICON')}"
								title="#{supplierMsgs.TOOLTIP_ACTION_IGNORE_QUOTE}"
								style="border-left:0px;border-right:0px;border-top:0px;border-bottom:0px" />
						</ice:commandLink>
					</ace:column>
				</ace:dataTable>
				<ice:message for="messageBoardId" styleClass="iceMsgInfo"></ice:message>
			</center>
		</div>
	</h:form>
	<h:form id="quoteReplyDialogForm">
		<ace:confirmationDialog id="messageDialog"
			widgetVar="#{quoteEventReplyListMBean.messageDialog.dialogWidgetVar}"
			message="#{quoteEventReplyListMBean.messageDialog.message}"
			header="Confirmation" width="400" closable="true" position="center"
			modal="true">
			<center>
				<ice:panelGrid columns="1">
					<ice:outputLabel
						value="#{supplierMsgs.SEND_QUOTE_TO_BUYER_FORM_COMMENTS}" />
					<ice:inputTextarea id="buyerCommentsID"
						binding="#{quoteEventReplyListMBean.widgetBuyerComments}"
						value="#{quoteEventReplyListMBean.buyerComments}" rows="10"
						required="true" cols="40"></ice:inputTextarea>
					<ice:message styleClass="iceMsgError" style="color:red;"
						for="buyerCommentsID" />
				</ice:panelGrid>
				<ice:panelGrid columns="2">
					<h:commandButton id="yes" value="#{msgs_common.COMMAND_ACTION_YES}"
						actionListener="#{quoteEventReplyListMBean.actionApproveOrAmendOrIgnoreQuote}"
						styleClass="small color green button">
					</h:commandButton>
					<h:commandButton id="no" value="#{msgs_common.COMMAND_ACTION_NO}"
						immediate="true"
						actionListener="#{quoteEventReplyListMBean.messageDialog.hideDialog}"
						styleClass="small color green button" />
					<ice:inputHidden name="requestJSON"
						value="#{quoteEventReplyListMBean.messageDialog.requestJSON}"></ice:inputHidden>
				</ice:panelGrid>
			</center>
		</ace:confirmationDialog>
		<ui:include src="/assets/pages/core/messageBoard.xhtml"></ui:include>
	</h:form>
</h:body>
</html>
